﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter2.Section3
{
    public class Example05
    {
        public Example05()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Function.ToLastType<double,double,double> f
                = new V.Function.ToLastType<double,double,double>(func);
            V.Point p = new V.Point(2);
            p.Coordinate[0] = 1.0;
            p.Coordinate[1] = 0.0;
            V.TangentPlaneOfGraph obj = new V.TangentPlaneOfGraph(f,p);
            obj.Compute();

            result += obj.CoefficientOfX.ToString() + "\r\n";

            result += obj.CoefficientOfY.ToString() + "\r\n";

            result += obj.Constant.ToString() + "\r\n";
        }
        private double func(double x,double y)
        {
            return x * x + y * y * y * y + Math.Exp(x * y);
        }
    }
}
/* 
1.99999999999973
0.999999999999774
2.70672373403613E-13
*/
